import React ,{Component} from "react"
import {View,Text,TouchableOpacity,Modal} from "react-native"
import {connect} from "react-redux";
import SelectListComponent from '../../components/SelectListComponent'
import NavigationComponent from "../../components/NavigationComponent";
import SelectListModal from "../../components/modals/SelectListModal";
class LatestInformation extends Component{
    constructor(props) {
        super(props);
        this.state = {
            showModal:true
        };
        this.closeModal = this.closeModal.bind(this);

    }

    closeModal(){
        this.setState({
            showModal:false
        })
    }

    render(): React.ReactNode {

        return <View >
            <NavigationComponent title="最新资讯" back={true}/>
            <Text onPress={()=>{this.setState({showModal:true})}} style={{fontSize:48}}>最新资讯</Text>

            <Modal
                animationType={"slide"}
                transparent={true}
                visible={this.state.showModal}
                onRequestClose={this.closeModal}
                style={{backgroundColor:"red"}}>
                    <SelectListComponent data={ ["日用类","服装类","母婴类","餐饮类"]}
                                         click={(value,key)=>{
                                             setTimeout(()=>{
                                                this.setState({showModal:false});
                                             },100);
                                             console.log("props ==>",value,key)}
                                         }/>
            </Modal>

        </View>;
    }

}

export default connect(
    (state) => {
        return {
        }
    },
    (dispatch) => ({

    })
)(LatestInformation)